﻿// <copyright file="IEnOceanService.cs" company="Hallvard Korsgaard">
//  Microsoft Public License (Ms-PL). See license details here: http://enoceannet.codeplex.com/license
// </copyright>
// <author>Hallvard Korsgaard</author>

namespace ServiceContract
{
  using System.Collections.Generic;
  using System.ServiceModel;

  /// <summary>
  /// The service contract to use with WCF.
  /// </summary>
  [ServiceContract(Namespace = "http://enoceannet.codeplex.com/EnOceanReceiver/v1")]
  public interface IEnOceanReceiver
  {
    /// <summary>
    /// The service should return a list of sensor id's that the service wants updates from, or NULL to receive updates from any sensor.
    /// </summary>
    /// <returns>A list of sensor id's that the service wants updates from, or NULL to receive updates from any sensor.</returns>
    [OperationContract(Action = "Subscriptions")]
    IEnumerable<long> Subscriptions();

    /// <summary>
    /// This method is called when a sensor is triggered.
    /// </summary>
    /// <param name="sensorData">The sensor data.</param>
    [OperationContract(Action = "SensorUpdated", IsOneWay = true)]
    void SensorUpdated(SensorData sensorData);
    
  }
}
